<?php
class Ubic_ubicacion extends Modelo_base {

	var $table = 'ubic_ubicacion';

	var $has_one = array('ubic_calle', 'ubic_localidad');
    var $has_many = array('cli_cliente');

    // Validaciones de campos
    var $validation = array(
        'altura' => array(
            'label' => 'Altura',
            'rules' => array('integer')
            ),
        'piso' => array(
            'label' => 'Piso',
            'rules' => array('trim', 'max_length' => 5),
            'get_rules' => array('trim')
            ),
        'depto' => array(
            'label' => 'Departamento',
            'rules' => array('trim', 'max_length' => 5),
            'get_rules' => array('trim')
            ),
        'ubic_calle' => array(
            'label' => 'Calle',
            'rules' => array('required')
            ),
        'ubic_localidad' => array(
            'label' => 'Localidad',
            'rules' => array('required')
            )
    );

    // Optionally, don't include a constructor if you don't need one.
    function __construct($id = NULL)
    {
        parent::__construct($id);
    }

    public function getLocalidad()
    {
        return new Ubic_localidad($this->ubic_localidad_id);
    }
}

/* End of file ubic_ubicacion.php */
/* Location: ./application/models/ubic_ubicacion.php */